home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / chat / ircii-2.8he / ircii-2 / help / ALIAS / functions < prev    next >
Encoding:
Text File  |  1994-10-16  |  4.4 KB  |  85 lines

  1. IRCII Functions
  2.   IRCII functions are substituted with the format $FUNCTION(arguments).
  3.   A function is an ALIAS which assigns a value to FUNCTION_RETURN.
  4.   For example:
  5.     ALIAS DOUBLE assign FUNCTION_RETURN ${[$0]+[$0]}
  6.   which is the same as:
  7.     ALIAS DOUBLE @ function_return = [$0] * 2
  8.   used with:
  9.     ALIAS SHOWDOUBLE echo $DOUBLE($0)
  10.   will cause
  11.     SHOWDOUBLE 7
  12.   to display "14".
  13.  
  14.   The following built-in functions already exist and cannot be overriden:
  15.  
  16.   LEFT(COUNT STRING)    Returns the COUNT leftmost bytes from the STRING.
  17.   RIGHT(COUNT STRING)   Returns the COUNT rightmost bytes from the STRING.
  18.   MID(INDEX COUNT STRING) Returns COUNT bytes starting at position INDEX
  19.                         in STRING.
  20.   INDEX(CHARLIST STRING) Returns the index to the first character in STRING
  21.                         which appears in CHARLIST.
  22.   RINDEX(CHARLIST STRING) Returns the index to the last character in STRING
  23.             which appears in CHARLIST.
  24.   TIME()                Returns the current system time as a long integer
  25.   STIME(TIMEVAL)        Returns the date and time in English that corresponds
  26.                         to the long integer TIMEVAL.
  27.   TDIFF(TIME_INTERVAL)    Takes a TIME_INTERVAL in seconds and returns it in 
  28.             the format.. dd days hh hours mm minutes ss seconds
  29.             Any fields with 00 are omitted.
  30.   RAND(LIMIT)           Returns a random number x such that 0<=x<LIMIT
  31.   SRAND(SEED)           Seeds the random number generator and returns nothing.
  32.                         The seed may be a long integer, although only the low
  33.                         integer is used.
  34.   USERHOST()            Returns the user@host value under which the current
  35.                         message was sent if you are on a 2.7 server or better.
  36.   MATCH(PATTERN WORDS)  Returns an index into the list of WORDS of the first
  37.                         match for the given PATTERN. Returns 1 if it matches
  38.                         the first word, 0 if it matches none.
  39.   RMATCH(WORD PATTERNS) Returns an index into the list of PATTERNS of the
  40.                         pattern which best matches the given WORD. Returns
  41.                         1 for the first pattern, 0 for none.
  42.   WORD(INDEX WORDS)    Returns the single word in the list of WORDS pointed
  43.             to by INDEX.
  44.   STRIP(CHARLIST STRING) Returns the STRING with all occurrences of characters
  45.                         listed in CHARLIST removed.
  46.   CONNECT(HOST PORT)    Returns the file descriptor for the connection.
  47.             A NULL fd means host could not be resolved.
  48.             Negative fd means some error occurred in the attempt.
  49.             Communication through the connection is done with 
  50.             DCC RAW and ON DCC_RAW.
  51.                         (See DCC RAW and ON DCC_RAW)
  52.   LISTEN(PORT)        Creates a listening socket on the specified port.
  53.             If the port # is not specified then it returns the 
  54.             number of the port it chose arbitrarily.  It cannot
  55.             open a port# < 1025
  56.   ISCHANNEL(word)       Returns 1 if word is a valid channel name.
  57.   ISCHANOP(nick channel) Returns 1 if nick is a chanop on the given channel.
  58.   WINNUM()              Returns the current window number.  This is always 
  59.             the window which is indicated by STATUS_WINDOW.
  60.   WINNAM()              Returns the current window name.
  61.                         This is always the window which is indicated by 
  62.             STATUS_WINDOW.  If the window has no name, it returns
  63.                         nothing.
  64.   ENCODE(input text)    Convert input text to an encoded string suitable for
  65.             use as an ircII variable or alias name.  Any special
  66.             including spaces can be encoded into the string.
  67.   DECODE(encoded text)    Decode a single STRING of text produced by ENCODE()
  68.             into it's original characters.  Note that these are
  69.             case sensitive.
  70.   TOUPPER(string)       Convert string to upper case.
  71.   TOLOWER(string)       Convert string to lower case.
  72.   CURPOS()        Returns the postition from the start of the input line
  73.             to where the cursor is now.
  74.   MYCHANNELS(refnum)    Returns a string with a list of channels on that
  75.                         windows server. (defaults to current window)
  76.   MYSERVERS()        Returns a string of the names of the servers
  77.             you are connected to.
  78.   ONCHANNEL(nick channel) Returns 1 if nick is on channel
  79.   PID()            Returns the current process ID.
  80.   PPID()        Returns the current parent process iD.
  81.   CHANUSERS(channel)    Returns a list of users on channel.
  82.  
  83. Note:
  84.   The argument separator for functions is the space character, not the comma.
  85.